package com.njiandan.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * Created by Administrator on 2015/9/9.
 */
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        //接收广播：系统启动完成后运行程序
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
            Intent newIntent = new Intent(context, LocationService.class);
            context.startService(newIntent);
        }

        if (intent.getAction().equals("android.intent.action.PACKAGE_ADDED")) {
            Intent newIntent = new Intent(context, LocationService.class);
            context.startService(newIntent);
        }

        if (intent.getAction().equals("android.intent.action.LOCALE_CHANGED")) {
            Log.i("区域设置", "*******************************区域设置发生了改变**********************");

            Intent newIntent = new Intent(context, LocationService.class);
            context.startService(newIntent);
        }
    }
}
